<?php

namespace mz\ars;

use Yii;

class Contact extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%contact}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['wechat','tel','qq', 'address'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'tel' => 'Tel',
            'qq' => 'Qq',
            'wechat' => 'Wechat',
            'address' => 'Address'
        ];
    }
    # 获取联系方式
    public static function getFindOne($id)
    {
        $query = static::find()->where(['id' => $id])->asArray()->one();
        return $query;
    }

}
